package com.xy.job.admin.controller

import com.xy.job.admin.api.request.RegisteredNodeQueryParam
import com.xy.job.admin.api.response.PageDTO
import com.xy.job.admin.service.NodeRegistryService
import com.xy.job.core.api.response.wrapperResponse
import io.swagger.v3.oas.annotations.Hidden
import io.swagger.v3.oas.annotations.tags.Tag
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@Hidden
@Tag(name = "NodeRegistryApi")
@RestController
@RequestMapping("/api/nodeRegistry")
class NodeRegistryController(
    var nodeRegistryService: NodeRegistryService,
){

    @GetMapping("/list")
    fun listRegistry(param: RegisteredNodeQueryParam) = wrapperResponse {
        val page = nodeRegistryService.listRegistry(param)
        return@wrapperResponse PageDTO(page)
    }
}